package com.minelx.hellopandas.core;

import com.alibaba.fastjson.JSONObject;

import java.util.List;

public class JoinOption {

	private final DataFrameDescription joinedCsv;

	private final String how;

	private final List<String> leftOn;

	private final List<String> rightOn;

	public JoinOption(DataFrameDescription joinedCsv, String how, List<String> leftOn, List<String> rightOn) {
		this.joinedCsv = joinedCsv;
		this.how = how;
		this.leftOn = leftOn;
		this.rightOn = rightOn;
	}

	public JSONObject toJSONObject() {
		JSONObject result = new JSONObject();
		result.put("joinedCsv", joinedCsv.dumpToJSON());
		result.put("how", how);
		result.put("leftOn", leftOn);
		result.put("rightOn", rightOn);
		return result;
	}
}
